package cn.zsb.printer;

/**
 * @author oldliu
 * @since 1.0
 */
//打印机
public class Printer {
    //品牌和价格
    private String brand;
    private int price;

    private Ink ink;//墨水接口
    private TextPaper paper;
    public Printer(){
    }
    public Printer(String brand,int price){
        System.out.println("2个参数的构造方法");
        this.brand=brand;
        this.price=price;
    }

    public void print(String str){
        System.out.println("当前打印机品牌是"+brand+"，价格是"+price);
        System.out.println("使用"+ink.getColor()+"打印");
        paper.print(str);
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(TextPaper paper) {
        this.paper = paper;
    }
}
